package com.wry.wry_test.demo.proxy;

/**
 * @Author: wangrongyi
 * @Date: 2024/11/25 11:35
 * @Description:
 */
public class Main {
    public static void main(String[] args) {
//        //获取代理对象
//        ProxyFactory factory = new ProxyFactory();
//
//        SellTickets proxyObject = factory.getProxyObject();
//        proxyObject.sell();
//        //打印生成的动态代理类名称
//        System.out.println(proxyObject.getClass());
//        while (true){}


        //创建代理工厂对象
        CglibProxyFactory factory = new CglibProxyFactory();
        //获取代理对象
        TrainStation proxyObject = factory.getProxyObject();

        proxyObject.sell();

        System.out.println(proxyObject.getClass());
        while (true){}
    }
}
